<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OrangeCNC - ARISC firmware documentation: mod_pulsgen.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrangeCNC - ARISC firmware documentation
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mod__pulsgen_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">mod_pulsgen.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="mod__pulsgen_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef _MOD_PULSGEN_H</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#define _MOD_PULSGEN_H</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mod__msg_8h.html">mod_msg.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mod__timer_8h.html">mod_timer.h</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a301a90fda88beb1da30012ca6b9c11e4">   20</a></span>&#160;<span class="preprocessor">#define PULSGEN_CH_CNT      32  </span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a28f313a68a237a145d8065457a6f9a3d">   21</a></span>&#160;<span class="preprocessor">#define PULSGEN_FIFO_SIZE   4   </span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor"></span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html">   27</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structpulsgen__ch__t.html">pulsgen_ch_t</a></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;{</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a83a04ad582de2b7d36b96f9db429c2c6">   29</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a83a04ad582de2b7d36b96f9db429c2c6">port</a>;               <span class="comment">// GPIO port number</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#adb86b9d6ab8039a33f3e0aab67ef57a3">   30</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#adb86b9d6ab8039a33f3e0aab67ef57a3">pin_mask</a>;           <span class="comment">// GPIO pin mask</span></div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#accbd1609875ecdc8b9c0575b72e84892">   31</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#accbd1609875ecdc8b9c0575b72e84892">pin_mask_not</a>;       <span class="comment">// GPIO pin ~mask</span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a93dde74fef44def5407a54c88bd742f7">   32</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a93dde74fef44def5407a54c88bd742f7">pin_inverted</a>;       <span class="comment">// same as `pin_mask` or 0</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#ac064e347dd925fff522092558d00a490">   34</a></span>&#160;    uint8_t     <a class="code" href="structpulsgen__ch__t.html#ac064e347dd925fff522092558d00a490">task</a>;               <span class="comment">// 0 = &quot;channel disabled&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a75b4ea125202228ed86690ae46a778c6">   35</a></span>&#160;    uint8_t     <a class="code" href="structpulsgen__ch__t.html#a75b4ea125202228ed86690ae46a778c6">task_infinite</a>;      <span class="comment">// 0 = &quot;make task_toggles and disable the channel&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#ab24b2c016c493b4c52a9fcf1abf24b07">   36</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#ab24b2c016c493b4c52a9fcf1abf24b07">task_toggles</a>;       <span class="comment">// pin toggles for this task</span></div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a5000d5faa5db2fd66ff0345eefd23e6c">   37</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a5000d5faa5db2fd66ff0345eefd23e6c">task_toggles_todo</a>;  <span class="comment">// pin toggles left to do for this task</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a94c5643af19ec94322edaff8af1fcd0e">   39</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a94c5643af19ec94322edaff8af1fcd0e">tasks_done</a>;         <span class="comment">// total number of tasks done</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#acd98b787b790ec28958bca82a9fedc34">   40</a></span>&#160;    uint8_t     <a class="code" href="structpulsgen__ch__t.html#acd98b787b790ec28958bca82a9fedc34">toggles_dir</a>;        <span class="comment">// 0 = cnt++, !0 = cnt--</span></div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#af6f803593aee8c037d7703d205765df2">   41</a></span>&#160;    int32_t     <a class="code" href="structpulsgen__ch__t.html#af6f803593aee8c037d7703d205765df2">cnt</a>;                <span class="comment">// total number of pin toggles</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a5923fa6a48da93d9579b7d027124a322">   43</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a5923fa6a48da93d9579b7d027124a322">setup_ticks</a>;        <span class="comment">// number of CPU ticks to prepare pin toggle</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a304338c045a89b201058803169dad343">   44</a></span>&#160;    uint32_t    <a class="code" href="structpulsgen__ch__t.html#a304338c045a89b201058803169dad343">hold_ticks</a>;         <span class="comment">// number of CPU ticks to hold pin state</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a36c99bb40f38f52fedba49239b39c1ab">   46</a></span>&#160;    uint8_t     <a class="code" href="structpulsgen__ch__t.html#a36c99bb40f38f52fedba49239b39c1ab">abort_on_setup</a>;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a69a7d18666dfc03d713bb6d15e192cde">   47</a></span>&#160;    uint8_t     <a class="code" href="structpulsgen__ch__t.html#a69a7d18666dfc03d713bb6d15e192cde">abort_on_hold</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structpulsgen__ch__t.html#a8877063788184b18eadf986ed313ba26">   49</a></span>&#160;    uint64_t    <a class="code" href="structpulsgen__ch__t.html#a8877063788184b18eadf986ed313ba26">todo_tick</a>;          <span class="comment">// timestamp (in CPU ticks) to change pin state</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;};</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html">   52</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structpulsgen__fifo__item__t.html">pulsgen_fifo_item_t</a></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#a4b1141237b480e4c38afe96a59ca4cad">   54</a></span>&#160;    uint8_t <a class="code" href="structpulsgen__fifo__item__t.html#a4b1141237b480e4c38afe96a59ca4cad">used</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#acd98b787b790ec28958bca82a9fedc34">   55</a></span>&#160;    uint8_t <a class="code" href="structpulsgen__fifo__item__t.html#acd98b787b790ec28958bca82a9fedc34">toggles_dir</a>;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#a8cb6815aa8abf71a064c78bcf41a383b">   56</a></span>&#160;    uint32_t <a class="code" href="structpulsgen__fifo__item__t.html#a8cb6815aa8abf71a064c78bcf41a383b">toggles</a>;</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#a9bdc1a313cca3a0673fa2274f459c909">   57</a></span>&#160;    uint32_t <a class="code" href="structpulsgen__fifo__item__t.html#a9bdc1a313cca3a0673fa2274f459c909">pin_setup_time</a>;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#a0d6010d7331d716ae8d387e9452cd773">   58</a></span>&#160;    uint32_t <a class="code" href="structpulsgen__fifo__item__t.html#a0d6010d7331d716ae8d387e9452cd773">pin_hold_time</a>;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structpulsgen__fifo__item__t.html#a30102e0b364c4843924559c08e20338d">   59</a></span>&#160;    uint32_t <a class="code" href="structpulsgen__fifo__item__t.html#a30102e0b364c4843924559c08e20338d">start_delay</a>;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;};</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keyword">enum</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a0cfdb83de97fed5390059a75ece1a2a1">   67</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a0cfdb83de97fed5390059a75ece1a2a1">PULSGEN_MSG_PIN_SETUP</a> = 0x20,</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a4bab926d9eebfd828ccb350b65e1ec63">   68</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a4bab926d9eebfd828ccb350b65e1ec63">PULSGEN_MSG_TASK_ADD</a>,</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a43d1c7d21037ab0dd6f3cf0957955776">   69</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a43d1c7d21037ab0dd6f3cf0957955776">PULSGEN_MSG_ABORT</a>,</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a70976c7b78553d057bd361d5ba4a2b46">   70</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a70976c7b78553d057bd361d5ba4a2b46">PULSGEN_MSG_STATE_GET</a>,</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a988d85bb42c9d38844e2248144f726d4">   71</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a988d85bb42c9d38844e2248144f726d4">PULSGEN_MSG_TASK_TOGGLES_GET</a>,</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635ab81f3f694042d6a12459f3c260403e0a">   72</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635ab81f3f694042d6a12459f3c260403e0a">PULSGEN_MSG_CNT_GET</a>,</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a3c1e65ab7b57dd0e115890fea0510565">   73</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a3c1e65ab7b57dd0e115890fea0510565">PULSGEN_MSG_CNT_SET</a>,</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635aaa712597dfb937af3f61747a473a7dd6">   74</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635aaa712597dfb937af3f61747a473a7dd6">PULSGEN_MSG_TASKS_DONE_GET</a>,</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a47ef2555d0131ec5e7f66628a97a9190">   75</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a47ef2555d0131ec5e7f66628a97a9190">PULSGEN_MSG_TASKS_DONE_SET</a>,</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a19cda710dd1ce32c296c9e9f8c1cc1a2">   76</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a19cda710dd1ce32c296c9e9f8c1cc1a2">PULSGEN_MSG_WATCHDOG_SETUP</a>,</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a7c871ffc7aa95b514eb231b76519e993">   77</a></span>&#160;    <a class="code" href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a7c871ffc7aa95b514eb231b76519e993">PULSGEN_MSG_CNT</a></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;};</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="mod__pulsgen_8h.html#a0b184ac62abfc34423ece76aa7b648dc">   81</a></span>&#160;<span class="preprocessor">#define PULSGEN_MSG_BUF_LEN MSG_LEN</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment">// export public methods</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#a2ac838d9e64c5d4788ca9a6044f2d438">pulsgen_module_init</a>();</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#a0e4e48600db54f687841b493229aff25">pulsgen_module_base_thread</a>();</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#aaf0da9f93d3f28063e2e7e5fd5aedcd1">pulsgen_pin_setup</a>(uint8_t c, uint8_t <a class="code" href="structpulsgen__ch__t.html#a83a04ad582de2b7d36b96f9db429c2c6">port</a>, uint8_t pin, uint8_t inverted);</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#ade550796ab335050c69edad17eaf901d">pulsgen_task_add</a>(uint32_t c, uint32_t <a class="code" href="structpulsgen__ch__t.html#acd98b787b790ec28958bca82a9fedc34">toggles_dir</a>, uint32_t toggles, uint32_t pin_setup_time, uint32_t pin_hold_time, uint32_t start_delay);</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#a3fd45bd82867966136b402354ca5b378">pulsgen_abort</a>(uint8_t c, uint8_t on_hold);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;uint8_t <a class="code" href="mod__pulsgen_8h.html#ae49c2b0c123c0328dc0b352edf1ccc56">pulsgen_state_get</a>(uint8_t c);</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;uint32_t <a class="code" href="mod__pulsgen_8h.html#a47e187a3a4d2366e008411c2eb41f7a5">pulsgen_task_toggles_get</a>(uint8_t c);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;int32_t <a class="code" href="mod__pulsgen_8h.html#aaf0f038aea5a130a3f24c34654bd0eaf">pulsgen_cnt_get</a>(uint8_t c);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#a982410ed1bac5a0db27b60b027ac9406">pulsgen_cnt_set</a>(uint8_t c, int32_t value);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;uint32_t <a class="code" href="mod__pulsgen_8h.html#a686d12d41d8c446583a29ab6d6db5999">pulsgen_tasks_done_get</a>(uint8_t c);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#a176dc5c37ce6f627e4344e45b9b7c265">pulsgen_tasks_done_set</a>(uint8_t c, uint32_t tasks);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;int8_t <span class="keyword">volatile</span> <a class="code" href="mod__pulsgen_8h.html#a03a23b001e94bf2b0bf906148fbc96fb">pulsgen_msg_recv</a>(uint8_t type, uint8_t * msg, uint8_t length);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keywordtype">void</span> <a class="code" href="mod__pulsgen_8h.html#ae47f3fa6b83367afb1ed891a2566882c">pulsgen_watchdog_setup</a>(uint8_t enable, uint32_t time);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="structpulsgen__ch__t_html_a83a04ad582de2b7d36b96f9db429c2c6"><div class="ttname"><a href="structpulsgen__ch__t.html#a83a04ad582de2b7d36b96f9db429c2c6">pulsgen_ch_t::port</a></div><div class="ttdeci">uint32_t port</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:29</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a5000d5faa5db2fd66ff0345eefd23e6c"><div class="ttname"><a href="structpulsgen__ch__t.html#a5000d5faa5db2fd66ff0345eefd23e6c">pulsgen_ch_t::task_toggles_todo</a></div><div class="ttdeci">uint32_t task_toggles_todo</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:37</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_ae47f3fa6b83367afb1ed891a2566882c"><div class="ttname"><a href="mod__pulsgen_8h.html#ae47f3fa6b83367afb1ed891a2566882c">pulsgen_watchdog_setup</a></div><div class="ttdeci">void pulsgen_watchdog_setup(uint8_t enable, uint32_t time)</div><div class="ttdoc">enable/disable abort all watchdog </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:392</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_ae49c2b0c123c0328dc0b352edf1ccc56"><div class="ttname"><a href="mod__pulsgen_8h.html#ae49c2b0c123c0328dc0b352edf1ccc56">pulsgen_state_get</a></div><div class="ttdeci">uint8_t pulsgen_state_get(uint8_t c)</div><div class="ttdoc">get current task state for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:317</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_acd98b787b790ec28958bca82a9fedc34"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#acd98b787b790ec28958bca82a9fedc34">pulsgen_fifo_item_t::toggles_dir</a></div><div class="ttdeci">uint8_t toggles_dir</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:55</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a686d12d41d8c446583a29ab6d6db5999"><div class="ttname"><a href="mod__pulsgen_8h.html#a686d12d41d8c446583a29ab6d6db5999">pulsgen_tasks_done_get</a></div><div class="ttdeci">uint32_t pulsgen_tasks_done_get(uint8_t c)</div><div class="ttdoc">get total pin toggles </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:367</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_ac064e347dd925fff522092558d00a490"><div class="ttname"><a href="structpulsgen__ch__t.html#ac064e347dd925fff522092558d00a490">pulsgen_ch_t::task</a></div><div class="ttdeci">uint8_t task</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:34</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a47ef2555d0131ec5e7f66628a97a9190"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a47ef2555d0131ec5e7f66628a97a9190">PULSGEN_MSG_TASKS_DONE_SET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:75</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a03a23b001e94bf2b0bf906148fbc96fb"><div class="ttname"><a href="mod__pulsgen_8h.html#a03a23b001e94bf2b0bf906148fbc96fb">pulsgen_msg_recv</a></div><div class="ttdeci">int8_t volatile pulsgen_msg_recv(uint8_t type, uint8_t *msg, uint8_t length)</div><div class="ttdoc">&quot;message received&quot; callback </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:416</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635aaa712597dfb937af3f61747a473a7dd6"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635aaa712597dfb937af3f61747a473a7dd6">PULSGEN_MSG_TASKS_DONE_GET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:74</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a982410ed1bac5a0db27b60b027ac9406"><div class="ttname"><a href="mod__pulsgen_8h.html#a982410ed1bac5a0db27b60b027ac9406">pulsgen_cnt_set</a></div><div class="ttdeci">void pulsgen_cnt_set(uint8_t c, int32_t value)</div><div class="ttdoc">set total pin toggles value </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:354</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a5923fa6a48da93d9579b7d027124a322"><div class="ttname"><a href="structpulsgen__ch__t.html#a5923fa6a48da93d9579b7d027124a322">pulsgen_ch_t::setup_ticks</a></div><div class="ttdeci">uint32_t setup_ticks</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:43</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_aaf0da9f93d3f28063e2e7e5fd5aedcd1"><div class="ttname"><a href="mod__pulsgen_8h.html#aaf0da9f93d3f28063e2e7e5fd5aedcd1">pulsgen_pin_setup</a></div><div class="ttdeci">void pulsgen_pin_setup(uint8_t c, uint8_t port, uint8_t pin, uint8_t inverted)</div><div class="ttdoc">setup GPIO pin for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:158</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a94c5643af19ec94322edaff8af1fcd0e"><div class="ttname"><a href="structpulsgen__ch__t.html#a94c5643af19ec94322edaff8af1fcd0e">pulsgen_ch_t::tasks_done</a></div><div class="ttdeci">uint32_t tasks_done</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:39</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_a8cb6815aa8abf71a064c78bcf41a383b"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#a8cb6815aa8abf71a064c78bcf41a383b">pulsgen_fifo_item_t::toggles</a></div><div class="ttdeci">uint32_t toggles</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:56</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a43d1c7d21037ab0dd6f3cf0957955776"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a43d1c7d21037ab0dd6f3cf0957955776">PULSGEN_MSG_ABORT</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:69</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a0cfdb83de97fed5390059a75ece1a2a1"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a0cfdb83de97fed5390059a75ece1a2a1">PULSGEN_MSG_PIN_SETUP</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:67</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a47e187a3a4d2366e008411c2eb41f7a5"><div class="ttname"><a href="mod__pulsgen_8h.html#a47e187a3a4d2366e008411c2eb41f7a5">pulsgen_task_toggles_get</a></div><div class="ttdeci">uint32_t pulsgen_task_toggles_get(uint8_t c)</div><div class="ttdoc">get current pin state changes since task start </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:330</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a93dde74fef44def5407a54c88bd742f7"><div class="ttname"><a href="structpulsgen__ch__t.html#a93dde74fef44def5407a54c88bd742f7">pulsgen_ch_t::pin_inverted</a></div><div class="ttdeci">uint32_t pin_inverted</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:32</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a988d85bb42c9d38844e2248144f726d4"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a988d85bb42c9d38844e2248144f726d4">PULSGEN_MSG_TASK_TOGGLES_GET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:71</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html"><div class="ttname"><a href="structpulsgen__fifo__item__t.html">pulsgen_fifo_item_t</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:52</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_accbd1609875ecdc8b9c0575b72e84892"><div class="ttname"><a href="structpulsgen__ch__t.html#accbd1609875ecdc8b9c0575b72e84892">pulsgen_ch_t::pin_mask_not</a></div><div class="ttdeci">uint32_t pin_mask_not</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:31</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a2ac838d9e64c5d4788ca9a6044f2d438"><div class="ttname"><a href="mod__pulsgen_8h.html#a2ac838d9e64c5d4788ca9a6044f2d438">pulsgen_module_init</a></div><div class="ttdeci">void pulsgen_module_init()</div><div class="ttdoc">module init </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:56</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_a4b1141237b480e4c38afe96a59ca4cad"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#a4b1141237b480e4c38afe96a59ca4cad">pulsgen_fifo_item_t::used</a></div><div class="ttdeci">uint8_t used</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:54</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a8877063788184b18eadf986ed313ba26"><div class="ttname"><a href="structpulsgen__ch__t.html#a8877063788184b18eadf986ed313ba26">pulsgen_ch_t::todo_tick</a></div><div class="ttdeci">uint64_t todo_tick</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:49</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a0e4e48600db54f687841b493229aff25"><div class="ttname"><a href="mod__pulsgen_8h.html#a0e4e48600db54f687841b493229aff25">pulsgen_module_base_thread</a></div><div class="ttdeci">void pulsgen_module_base_thread()</div><div class="ttdoc">module base thread </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:75</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a7c871ffc7aa95b514eb231b76519e993"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a7c871ffc7aa95b514eb231b76519e993">PULSGEN_MSG_CNT</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:77</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a4bab926d9eebfd828ccb350b65e1ec63"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a4bab926d9eebfd828ccb350b65e1ec63">PULSGEN_MSG_TASK_ADD</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:68</div></div>
<div class="ttc" id="mod__msg_8h_html"><div class="ttname"><a href="mod__msg_8h.html">mod_msg.h</a></div><div class="ttdoc">ARM-ARISC message control module header. </div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a3fd45bd82867966136b402354ca5b378"><div class="ttname"><a href="mod__pulsgen_8h.html#a3fd45bd82867966136b402354ca5b378">pulsgen_abort</a></div><div class="ttdeci">void pulsgen_abort(uint8_t c, uint8_t on_hold)</div><div class="ttdoc">abort current task for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:272</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635ab81f3f694042d6a12459f3c260403e0a"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635ab81f3f694042d6a12459f3c260403e0a">PULSGEN_MSG_CNT_GET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:72</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a304338c045a89b201058803169dad343"><div class="ttname"><a href="structpulsgen__ch__t.html#a304338c045a89b201058803169dad343">pulsgen_ch_t::hold_ticks</a></div><div class="ttdeci">uint32_t hold_ticks</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:44</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_ade550796ab335050c69edad17eaf901d"><div class="ttname"><a href="mod__pulsgen_8h.html#ade550796ab335050c69edad17eaf901d">pulsgen_task_add</a></div><div class="ttdeci">void pulsgen_task_add(uint32_t c, uint32_t toggles_dir, uint32_t toggles, uint32_t pin_setup_time, uint32_t pin_hold_time, uint32_t start_delay)</div><div class="ttdoc">add a new task for the selected channel </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:188</div></div>
<div class="ttc" id="structpulsgen__ch__t_html"><div class="ttname"><a href="structpulsgen__ch__t.html">pulsgen_ch_t</a></div><div class="ttdoc">a channel parameters </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:27</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_af6f803593aee8c037d7703d205765df2"><div class="ttname"><a href="structpulsgen__ch__t.html#af6f803593aee8c037d7703d205765df2">pulsgen_ch_t::cnt</a></div><div class="ttdeci">int32_t cnt</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:41</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a36c99bb40f38f52fedba49239b39c1ab"><div class="ttname"><a href="structpulsgen__ch__t.html#a36c99bb40f38f52fedba49239b39c1ab">pulsgen_ch_t::abort_on_setup</a></div><div class="ttdeci">uint8_t abort_on_setup</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:46</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_ab24b2c016c493b4c52a9fcf1abf24b07"><div class="ttname"><a href="structpulsgen__ch__t.html#ab24b2c016c493b4c52a9fcf1abf24b07">pulsgen_ch_t::task_toggles</a></div><div class="ttdeci">uint32_t task_toggles</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:36</div></div>
<div class="ttc" id="mod__timer_8h_html"><div class="ttname"><a href="mod__timer_8h.html">mod_timer.h</a></div><div class="ttdoc">system timer control module header </div></div>
<div class="ttc" id="structpulsgen__ch__t_html_acd98b787b790ec28958bca82a9fedc34"><div class="ttname"><a href="structpulsgen__ch__t.html#acd98b787b790ec28958bca82a9fedc34">pulsgen_ch_t::toggles_dir</a></div><div class="ttdeci">uint8_t toggles_dir</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:40</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_a9bdc1a313cca3a0673fa2274f459c909"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#a9bdc1a313cca3a0673fa2274f459c909">pulsgen_fifo_item_t::pin_setup_time</a></div><div class="ttdeci">uint32_t pin_setup_time</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:57</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a70976c7b78553d057bd361d5ba4a2b46"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a70976c7b78553d057bd361d5ba4a2b46">PULSGEN_MSG_STATE_GET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:70</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a75b4ea125202228ed86690ae46a778c6"><div class="ttname"><a href="structpulsgen__ch__t.html#a75b4ea125202228ed86690ae46a778c6">pulsgen_ch_t::task_infinite</a></div><div class="ttdeci">uint8_t task_infinite</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:35</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_a30102e0b364c4843924559c08e20338d"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#a30102e0b364c4843924559c08e20338d">pulsgen_fifo_item_t::start_delay</a></div><div class="ttdeci">uint32_t start_delay</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:59</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_aaf0f038aea5a130a3f24c34654bd0eaf"><div class="ttname"><a href="mod__pulsgen_8h.html#aaf0f038aea5a130a3f24c34654bd0eaf">pulsgen_cnt_get</a></div><div class="ttdeci">int32_t pulsgen_cnt_get(uint8_t c)</div><div class="ttdoc">get total pin toggles </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:343</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_adb86b9d6ab8039a33f3e0aab67ef57a3"><div class="ttname"><a href="structpulsgen__ch__t.html#adb86b9d6ab8039a33f3e0aab67ef57a3">pulsgen_ch_t::pin_mask</a></div><div class="ttdeci">uint32_t pin_mask</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:30</div></div>
<div class="ttc" id="structpulsgen__ch__t_html_a69a7d18666dfc03d713bb6d15e192cde"><div class="ttname"><a href="structpulsgen__ch__t.html#a69a7d18666dfc03d713bb6d15e192cde">pulsgen_ch_t::abort_on_hold</a></div><div class="ttdeci">uint8_t abort_on_hold</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:47</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a3c1e65ab7b57dd0e115890fea0510565"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a3c1e65ab7b57dd0e115890fea0510565">PULSGEN_MSG_CNT_SET</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:73</div></div>
<div class="ttc" id="structpulsgen__fifo__item__t_html_a0d6010d7331d716ae8d387e9452cd773"><div class="ttname"><a href="structpulsgen__fifo__item__t.html#a0d6010d7331d716ae8d387e9452cd773">pulsgen_fifo_item_t::pin_hold_time</a></div><div class="ttdeci">uint32_t pin_hold_time</div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:58</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a176dc5c37ce6f627e4344e45b9b7c265"><div class="ttname"><a href="mod__pulsgen_8h.html#a176dc5c37ce6f627e4344e45b9b7c265">pulsgen_tasks_done_set</a></div><div class="ttdeci">void pulsgen_tasks_done_set(uint8_t c, uint32_t tasks)</div><div class="ttdoc">set total pin toggles value </div><div class="ttdef"><b>Definition:</b> mod_pulsgen.c:378</div></div>
<div class="ttc" id="mod__pulsgen_8h_html_a726ca809ffd3d67ab4b8476646f26635a19cda710dd1ce32c296c9e9f8c1cc1a2"><div class="ttname"><a href="mod__pulsgen_8h.html#a726ca809ffd3d67ab4b8476646f26635a19cda710dd1ce32c296c9e9f8c1cc1a2">PULSGEN_MSG_WATCHDOG_SETUP</a></div><div class="ttdef"><b>Definition:</b> mod_pulsgen.h:76</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="mod__pulsgen_8h.html">mod_pulsgen.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
